package com.tarena.lbs.business.dao.repository.impl;

// 注意：Repository 实现类应放在 repository.impl 包下（而非 service.impl）
// 建议包路径修改为：com.tarena.lbs.business.dao.repository.impl

import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.tarena.lbs.business.dao.mapper.BusinessCategoryMapper;
import com.tarena.lbs.business.dao.repository.BusinessCategoryRepository;
import com.tarena.lbs.business.pojo.po.BusinessCategoryPO;
import com.tarena.lbs.business.pojo.query.BusinessCategoryQuery;
import com.tarena.lbs.business.pojo.vo.BusinessCategoryVO;
import jakarta.annotation.Resource;// 注意：若用的是 Spring 框架，建议用 javax.annotation.Resource 而非 jakarta  修正1：注解从 @Service 改为 @Repository（标记为 Repository 层组件）
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository; // 改为 @Repository 注解

import java.util.List;

@Slf4j
@Repository
public class BusinessCategoryRepositoryImpl implements BusinessCategoryRepository {

    @Resource
    private BusinessCategoryMapper businessCategoryMapper;


    @Override
    public List<BusinessCategoryPO> getAllCategories() {
        log.info("通过Mapper查询所有商家分类数据");
        QueryWrapper<BusinessCategoryPO> queryWrapper = new QueryWrapper<>();
        return businessCategoryMapper.selectList(queryWrapper);
    }
}